<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');
?>
<style>
body {
	width:900px;
	margin:0 10px 0 0;
	font-size:14px;
}
.cont {
	float:left;
	margin:0 0 0 20px;
}
.page {
	margin:0 auto;
}
th {
	height:14px;
	font-size:14px;
}
tr {
	height:30px;
	border-bottom:1px solid #eee;
}

</style>
<form action="index.php" method="get" name="form1">
<input type="hidden" name="m" value="order">
<input type="hidden" name="c" value="manage">
<input type="hidden" name="a" value="ssdd">
<input type="hidden" name="menuid" value="1669">
<div id="historybox">
        <div id="title">
            <span class="spanleft">订单搜索</span>
        </div>
        <div class="divcontrol">
            <select name="leibie" id="ddlItem" style="width:85px;">
	<option value="1">订单编号</option>
	<option value="2">转运单号</option>

</select>
            <input name="tbKey" type="text" id="tbKey" onfocus="if(this.value=='请输入查找的内容'){this.value='';this.style.color='#000000'}" onblur="if(this.value==''){this.value='请输入查找的内容';this.style.color='#9C9C9C'}" style="color: rgb(153, 153, 153)" value="请输入查找的内容" class="input1">
            <span>开始：<link rel="stylesheet" type="text/css" href="http://www.fenglei.tk/statics/js/calendar/jscal2.css"/>
			<link rel="stylesheet" type="text/css" href="http://www.fenglei.tk/statics/js/calendar/border-radius.css"/>
			<link rel="stylesheet" type="text/css" href="http://www.fenglei.tk/statics/js/calendar/win2k.css"/>
			<script type="text/javascript" src="http://www.fenglei.tk/statics/js/calendar/calendar.js"></script>
			<script type="text/javascript" src="http://www.fenglei.tk/statics/js/calendar/lang/en.js"></script><input type="text" name="tbStart" id="tbStart" value="" size="10" class="date" readonly>&nbsp;<script type="text/javascript">
			Calendar.setup({
			weekNumbers: true,
		    inputField : "tbStart",
		    trigger    : "tbStart",
		    dateFormat: "%Y-%m-%d",
		    showTime: false,
		    minuteStep: 1,
		    onSelect   : function() {this.hide();}
			});
        </script> 
                结束：<input type="text" name="tbEnd" id="tbEnd" value="" size="10" class="date" readonly>&nbsp;<script type="text/javascript">
			Calendar.setup({
			weekNumbers: true,
		    inputField : "tbEnd",
		    trigger    : "tbEnd",
		    dateFormat: "%Y-%m-%d",
		    showTime: false,
		    minuteStep: 1,
		    onSelect   : function() {this.hide();}
			});
        </script></span>&nbsp;&nbsp;
            <input type="button" name="dosubmit" value="搜索" id="btSearch" class="buttonA" onclick="chgeshi()" style="font-weight:bold;height:20px;width:60px;">
        </div>
        <input type="text" hidden="hidden" name="dosubmit" value="true"/>
</form>
        <div id="divbody" style="width: 900px;">
             <div style="width: 900px;">
	<table cellspacing="0" cellpadding="4" align="Center" id="gvOrder" style="color:#333333;font-size:Medium;width:850px;border-collapse:collapse;text-align: center;
                font-size: large">
		<tbody><tr style="color:White;background-color:#507CD1;font-weight:bold;">
			<th scope="col">序号</th><th scope="col">会员名称</th><th scope="col">订单编号</th><th scope="col">转运单号</th><th scope="col">渠道类别</th><th scope="col">重量</th><th scope="col">订单价格</th><th scope="col">申报价值</th><th scope="col">日期</th><th scope="col">订单状态</th><th scope="col">更新状态</th>
		</tr>
		<?php foreach ($datas as $r){?>		
		<tr>
		<td><?php echo $r['id']?></td>
		<td><?php echo $r['username']?></td>
		<td><?php echo $r['orderid']?></td>
		<td><?php echo $r['zhnumber']?></td>
		<td>
		<?php 
		switch ($r['channel']){
			case 1:
				echo 'A渠道';
				break;
			case 2:
				echo 'B渠道';
				break;
			case 3:
				echo 'C渠道';
				break;
			case 4:
				echo 'D渠道';
				break;
			case 5:
				echo 'E渠道';
				break;
			case 6:
				echo 'F渠道';
				break;
		}
		?></td>
		<td><?php echo $r['weight'].'磅'?></td>		
		<td><?php echo $r['orderprice'].'元'?></td>
		<td><?php echo $r['sbvalue'].'元'?></td>
		<td><?php echo date('Y-m-d',$r['uptime'])?></td>
		<td>
		<?php 
		switch ($r['state']){
			case 1:
				echo '订单审核中';
				break;
			case 2:
				echo '审核完成待入库';
				break;
			case 3:
				echo '已入库';
				break;
			case 4:
				echo '转运中';
				break;
			case 5:
				echo '已出库';
				break;
			case 6:
				echo '运送完成';
				break;
			case 7:
				echo '订单已取消';
				break;
			default:
				echo '未知状态';
		}
		
		?>
		</td>
		<td><?php if($r['state']==6||$r['state']==7){echo '修改';}else{
			echo "<a href=\"index.php?m=order&c=manage&a=ddzt&orderid={$r['id']}\" style='color:red'>修改</a>";
		} ?></td>
		</tr>
		<?php }?>
        </tbody></table>    
</div> 
<div style="margin: 10px 0 0 300px"><?php echo $pages?></div>
<script type="text/javascript">
function chgeshi(){
	var d=new Date;
	var neirong=document.getElementById("tbKey");
	var stime=document.getElementById("tbStart");
	var etime=document.getElementById("tbEnd");
	//alert(typeof(d.getTime(stime)));
	stime=Number(d.getTime(stime));
	etime=Number(d.getTime(etime));
	//alert(d.getTime(stime));
	//alert(d.getTime(etime));
	//alert(typeof(etime.value));
	var pre=/^[0-9||a-z||A-Z]+$/;
	if(!pre.test(neirong.value)){
			alert("你输入的查询内容有误，查询的内容只能是字母和数字");
			return false;	
		}	
	if(stime>etime){
			alert("你查询的起始时间有误！");
			return false;
		}	
	form1.submit();			
}



</script>
</div>
</body>
</html>

